map is not a function in JavaScript